package com.md.tw.controller;

import com.md.tw.entity.Student;
import com.md.tw.service.StudentService;
import lombok.Data;

import java.util.List;

@Data

public class StudentController {

    private StudentService studentService;

    public List<Student> getAllStudents() {
        return studentService.getAllStudents();
    }

    public Student getStudentById(int id) {
        return studentService.getStudentById(id);
    }

    public String deleteStudentById(int id) {
        return studentService.deleteStudentById(id) ? "成功" : "失败";
    }

    public void insertStudent(Student student) {
        studentService.insertStudent(student);
    }

    public void updateStudent(Student student) {
        studentService.updateStudent(student);
    }
}
